// pages/home/home.js
Page({
  data: {
    //轮播图
    list:[],
    currentIndex: 0,
    //咖啡故事
    card:[],
    card_text:[],
    //新品展示
    newPro:[],
    newPro_text:[],
  },
  swiperChange(e) {
    var index = e.detail.current;
    this.setData({
      currentIndex: index,
    })
  },
  onReady(){
    var _this = this;
    wx.request({
      url: 'http://10.155.237.253:8888/coffee_wechatProject/data/homeData',
      success(res){
        _this.setData({
          list: res.data.swiperList,
          card: res.data.cardList,
          card_text: res.data.text,
          newPro: res.data.newPro,
          newPro_text: res.data.newProText,
        })
      }
    })
  }
})